package com.zhl.study.util;

import java.text.SimpleDateFormat;

/**
 * @description TODO
 * @Author: z156940l@outlook.com
 * @className ThreadSafeFormatterUtil
 * @Date: 2023/4/28 17:43
 */
public class ThreadSafeFormatterUtil {

    public static ThreadLocal<SimpleDateFormat> dateFormatThreadLocal = new ThreadLocal<SimpleDateFormat>() {

        //创建一份 SimpleDateFormat 对象
        @Override
        protected SimpleDateFormat initialValue() {
            return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        }
    };
}